<?php
/*
 VERCHECK.INC.PHP by martin $ 2009/12/25 15:34:13
*/

checkADMIN();

$helperState = isset($_COOKIE['PPBLOG_HELPER_STATE']) ? $_COOKIE['PPBLOG_HELPER_STATE'] : 1;

$header = $body = '';

$modules = my_glob('inc.php', 'modules/');
$update = array();

foreach ($modules as $module){
 if($fp = @fopen($module, "rb")){
  while(!feof($fp)){
   $line = fgets($fp);
   if(strpos($line, '$')){
    $update[] = trim(str_replace(array(' by martin ', '$', '/*'), '', $line));
    break;
   }
  } # while-loop
   fclose($fp);
 } # $fp
}
// */
$body .= '
<div style="width:99%;">
<h1 style="margin-bottom: .5em;">Updater</h1>
<ul class="p2em" style="margin: auto; width: 580px; display:'.($helperState?'block':'none').';">
 <li>上の全削除を実行すると元の画像だけでなくサムネイル化された画像も削除されます。</li>
</ul><p class="helper" onclick="toggleHelper(this);" title="説明を閉じる">　</p>
<div style="width: 510px; background:#eff1f3; margin:0 auto 20px auto;">
<table cellspacing="0" cellpadding="1" style="width: 98%; border:1px solid #333;">
 <colgroup><col style="width:150px;" /><col style="width:180px;" /><col style="width:180px;" /></colgroup>
 <tr style="text-align:center;background:url(Images/grad.png);max-height: 23px;">
  <th>モジュール名</th><th>タイムスタンプ</th><th>最新バージョン</th></tr>'.NL;
 $b = 'array('.NL;

foreach ($update as $dat){
 list($name, $date) = explode(" ", $dat, 2);
 $body .= '<tr><td>'.$name.'</td><td>'.$date.'</td><td>'.$date.'</td></tr>'.NL;
 $b .= '"'.$name.'" => "'.$date.'",'.NL;
}
 $b .= ')'.NL;
$body .= '</table>'.NL;

return $DIVISION['body'] .= $body;

?>
